##cmake_minimum_required( VERSION 2.8 )
project("ts plugin standart script engine")
find_package( Qt4 REQUIRED )

SET(QT_USE_QTSCRIPT TRUE)

ADD_DEFINITIONS(${QT_DEFINITIONS})
ADD_DEFINITIONS(-DQT_PLUGIN)
#ADD_DEFINITIONS(-DQT_NO_DEBUG)
ADD_DEFINITIONS(-DQT_SHARED)

include( ${QT_USE_FILE} )
INCLUDE_DIRECTORIES(
	${QT_INCLUDE_DIR}
	${QT_QTSQL_INCLUDE_DIR}
	${CMAKE_CURRENT_BINARY_DIR}
	../../../core/interfaces
)


set(INSTPREF ${CMAKE_INSTALL_PREFIX})
configure_file(../../../core/src/def.h.in def.h)

set( HEADERS
		tspl_se_std.h
		tspl_se_std_engine.h
	)
set( SOURCES
		tspl_se_std.cpp
		tspl_se_std_engine.cpp
	)

qt4_wrap_cpp(MOC ${HEADERS})

add_library(se_std SHARED ${SOURCES} ${MOC})

target_link_libraries(se_std ${QT_LIBRARIES} ${QT_QTSQL_LIBRARIES})

# install for linux
if(${CMAKE_SYSTEM_NAME} STREQUAL Linux)
		set(tsdir ${CMAKE_INSTALL_PREFIX})
		set(tsdir_pl ${tsdir}/lib/torisakura)
		install(TARGETS se_std DESTINATION ${tsdir_pl})
endif()

